<?php if(Nuo::isMember() && $item->getId() != Nuo::getUserId()): ?>
<?php
if (!isset($status))
{
	$status = Nuo::getApi('user') -> getStatusId(NULL, $item);
}

if(!isset($form)){
	$form = 1;
}

$phrase = 'Friend';
$icon = 'uiIconAddFriend';
$ufi =  $item->getHtmlId('ufi');
switch($status)
{
	case 1 :
		$icon = 'uiIconIsFriend';
		break;
	case 3 :
		$phrase = 'Accept Request';
		break;
	case 2 :
		$phrase = 'Request Sent';
		break;
}
?>
<?php if($form):?><form id="<?php echo $ufi; ?>" class="inlineBlock" aria-submit="async" action="<?php echo Nuo::getUrl('user/ajax/friend/button'); ?>"><?php endif; ?>
<?php if($status == 0): ?>	
	<input type="hidden" name="id" value="<?php echo $item -> getItemId(); ?>" />
	<input type="hidden" name="html_id" value="#<?php echo $ufi; ?>" />
	<input type="hidden" class="uiHidden uiHiddenAct" name="act" value="" /> 
	<a data-id="friend-<?php echo $item -> getItemId('friend'); ?>" aria-click="jscript" aria-cb="form.submit" class="inlineBlock" aria-act="request">
		<span class="uiButton uiSingleButton uiButtonLarge">
			<i class="uiIcon <?php echo $icon; ?>">&nbsp;</i>&nbsp;
			<span class="uiButtonText"><?php echo Intl::__($phrase); ?></span>
		</span>
	</a>
<?php else: ?>
	<input type="hidden" name="id" value="<?php echo $item -> getItemId(); ?>" />
	<input type="hidden" name="html_id" value="#<?php echo $ufi; ?>" />
	<input type="hidden" class="uiHidden uiHiddenAct" name="act" value="" />
	<a data-id="friend-<?php echo $item -> getItemId('friend'); ?>" uri="<?php echo Nuo::getUrl('user/ajax/friend/button?act=hover&id=' . $item -> getItemId()); ?>"  aria-click="jscript" aria-cb="form.submit" hover="cardhover" class="inlineBlock">
		<span class="uiButton uiSingleButton uiButtonLarge">
			<i class="uiIcon <?php echo $icon; ?>">&nbsp;</i>&nbsp;
			<span class="uiButtonText"><?php echo Intl::__($phrase); ?></span>
		</span>
	</a>
<?php endif; ?>
<?php if($form):?> </form> <?php endif; ?>

<?php endif; ?>